Skip to content

ngwmn-fix#589

Merged
jirhiker merged 1 commit intostagingfrom
ngwmn-fix
Mar 9, 2026
Merged

ngwmn-fix#589
jirhiker merged 1 commit intostagingfrom
ngwmn-fix

Conversation

@jirhiker
Copy link
Copy Markdown
Member

@jirhiker jirhiker commented Mar 9, 2026

Why

This PR addresses the following problem / context:

  • Use bullet points here

How

Implementation summary - the following was changed / added / removed:

  • Use bullet points here

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Use bullet points here

Copilot AI review requested due to automatic review settings March 9, 2026 22:06
@jirhiker jirhiker merged commit 661f2cf into staging Mar 9, 2026
10 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the NGWMN XML helper to make the response generation more robust by explicitly controlling SQL column ordering and normalizing XML text values.

Changes:

  • Added _as_text() to avoid serializing None as the literal string "None" in XML.
  • Replaced SELECT * with explicit column lists for lithology and well construction queries.
  • Updated XML builders to use _as_text() and to explicitly index the PointID field for some record types.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +48 to +52
sql = (
'select "PointID", "CasingTop", "CasingBottom", "CasingDepthUnits", '
'"ScreenTop", "ScreenBottom", "ScreenBottomUnit", "ScreenDescription", "CasingDescription" '
'from "NMA_view_NGWMN_WellConstruction" where "PointID"=:point_id'
)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make_well_construction_response now selects ScreenBottomUnit and CasingDescription, but make_well_construction() never writes those fields into the XML (it only uses indices 1-5 and 7). This makes the SQL harder to reason about and wastes work; either emit corresponding XML elements (e.g., include a unit element and casing description) or drop the unused columns from the SELECT so the tuple layout matches what is actually consumed.

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +23
def _as_text(v):
return "" if v is None else str(v)

Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes alter NGWMN XML serialization (explicit column ordering + _as_text(None) => empty string) but there are no tests exercising services/ngwmn_helper.py output. Adding a focused unit test that builds a representative row and asserts the generated XML (including None handling and correct PointID/column-to-element mapping) would help prevent regressions as the NGWMN view schemas evolve.

Copilot uses AI. Check for mistakes.
@jirhiker jirhiker deleted the ngwmn-fix branch March 12, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants